<html>
<head><meta charset="utf-8"><title>leak-check in coherence · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html">leak-check in coherence</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="217166971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217166971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217166971">(Nov 18 2020 at 17:16)</a>:</h4>
<p>I'm trying to migrate rust-semverver to newest nightly and since <a href="https://github.com/rust-lang/rust/pull/72493">https://github.com/rust-lang/rust/pull/72493</a> landed, I'm seeing a regression in region-related tests. This test basically changes one signature from <code>fn(_: &amp;str)</code> to <code>fn(_: &amp;'static str)</code> and vice versa: <a href="https://github.com/rust-lang/rust-semverver/tree/master/tests/cases/regions">https://github.com/rust-lang/rust-semverver/tree/master/tests/cases/regions</a></p>
<p>Disclaimer: Take everything below with a grain of salt, I tried to grok rustc-dev-guide about trait solving and HRTB to some degree, so I may confuse some things.<br>
Previously, semverver was trying to see if we can infer that types are equal in here (I assume this is <em>selection</em> part of solving?): <a href="https://github.com/rust-lang/rust-semverver/blob/be321bd1b53bacf6d28373a61f6de7877cade8ef/src/typeck.rs#L224-L230">here</a>. This returned <code>Err(RegionsInsufficientlyPolymorphic(BrAnon(0),ReStatic))</code>, which was what we wanted and could emit a nice error.<br>
However, after the change this just returns <code>Ok(())</code>, which regresses the current functionality.</p>
<p>Could you help point me in the right direction what I should do to bring back the old behaviour? From what I understand the original change moved leak-checking, which allows us to conclude that <code>fn(&amp;'static str)</code> does not satify `for &lt;'a&gt; fn(&amp;'a str), further down the pipeline and it now needs to be called explicitly in addition to trait selection (?)?</p>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> you authored the change, would you have a spare moment to point me in the right direction? Thanks!</p>



<a name="217176889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217176889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217176889">(Nov 18 2020 at 18:30)</a>:</h4>
<p>It seem something like this more or less works (the order is fixed is not correct in the emitted error), not sure if this is the right approach</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/src/typeck.rs b/src/typeck.rs</span>
<span class="gh">index 91a16b4..8247bf3 100644</span>
<span class="gd">--- a/src/typeck.rs</span>
<span class="gi">+++ b/src/typeck.rs</span>
<span class="gu">@@ -221,13 +221,17 @@ impl&lt;'a, 'tcx&gt; TypeComparisonContext&lt;'a, 'tcx&gt; {</span>
         use rustc_infer::infer::{InferOk, RegionckMode};
         use rustc_middle::ty::Lift;

<span class="gd">-        let error = self</span>
<span class="gd">-            .infcx</span>
<span class="gd">-            .at(&amp;ObligationCause::dummy(), target_param_env)</span>
<span class="gd">-            .eq(orig, target)</span>
<span class="gd">-            .map(|InferOk { obligations: o, .. }| {</span>
<span class="gd">-                assert_eq!(o, vec![]);</span>
<span class="gd">-            });</span>
<span class="gi">+        let error = self.infcx.commit_if_ok(|snapshot| {</span>
<span class="gi">+            let select = self</span>
<span class="gi">+                .infcx</span>
<span class="gi">+                .at(&amp;ObligationCause::dummy(), target_param_env)</span>
<span class="gi">+                .eq(orig, target)</span>
<span class="gi">+                .map(|InferOk { obligations: o, .. }| {</span>
<span class="gi">+                    assert_eq!(o, vec![]);</span>
<span class="gi">+                });</span>
<span class="gi">+            let leak_check = self.infcx.leak_check(true, snapshot);</span>
<span class="gi">+            select.and(leak_check)</span>
<span class="gi">+        });</span>

         if let Err(err) = error {
             let outlives_env = OutlivesEnvironment::new(target_param_env);
</code></pre></div>



<a name="217177746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217177746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217177746">(Nov 18 2020 at 18:36)</a>:</h4>
<p>uh, <code>overly_polymorphic</code> set to <code>false</code> fixes the issue</p>



<a name="217201639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217201639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217201639">(Nov 18 2020 at 21:53)</a>:</h4>
<p><span class="user-mention" data-user-id="153740">@Igor Matuszewski</span> so the <code>fn efg</code> is the one in question?</p>



<a name="217201758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217201758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217201758">(Nov 18 2020 at 21:54)</a>:</h4>
<p>adding in calls to <code>leak_check</code> is not the right approach for sure =)</p>



<a name="217248811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217248811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217248811">(Nov 19 2020 at 10:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <code>fn efg</code> and <code>fn fgh</code> (one changes from static to late bound lifetime and the other vice versa)</p>



<a name="217248848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217248848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217248848">(Nov 19 2020 at 10:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/leak-check.20in.20coherence/near/217201758">said</a>:</p>
<blockquote>
<p>adding in calls to <code>leak_check</code> is not the right approach for sure =)</p>
</blockquote>
<p>at least the tests are green <span aria-label="big smile" class="emoji emoji-1f604" role="img" title="big smile">:big_smile:</span></p>



<a name="217268783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217268783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217268783">(Nov 19 2020 at 13:32)</a>:</h4>
<p>part of this is that the logic here is changing</p>



<a name="217268804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217268804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217268804">(Nov 19 2020 at 13:32)</a>:</h4>
<p>that may indeed, technically, be a breaking change</p>



<a name="217274247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217274247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217274247">(Nov 19 2020 at 14:14)</a>:</h4>
<p><span class="user-mention" data-user-id="153740">@Igor Matuszewski</span> maybe we can schedule a time later today to sync up on this?</p>



<a name="217277936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217277936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217277936">(Nov 19 2020 at 14:41)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> sure! I’m free for the rest of the day so let me know when you’re available</p>



<a name="217281566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217281566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217281566">(Nov 19 2020 at 15:06)</a>:</h4>
<p><span class="user-mention" data-user-id="153740">@Igor Matuszewski</span> is <time datetime="2020-11-19T20:30:00Z">2020-11-19T15:30:00-05:00</time> or so too late for you?</p>



<a name="217293101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217293101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217293101">(Nov 19 2020 at 16:20)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> that’s fine</p>



<a name="217298543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217298543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217298543">(Nov 19 2020 at 16:57)</a>:</h4>
<p><span class="user-mention" data-user-id="153740">@Igor Matuszewski</span> ok ping me .. I'll be around then</p>



<a name="217298559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217298559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217298559">(Nov 19 2020 at 16:57)</a>:</h4>
<p>sure</p>



<a name="217298736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217298736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217298736">(Nov 19 2020 at 16:58)</a>:</h4>
<p>thanks for taking your time!</p>



<a name="217326392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217326392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217326392">(Nov 19 2020 at 20:31)</a>:</h4>
<p><span class="user-mention" data-user-id="153740">@Igor Matuszewski</span> wave</p>



<a name="217326830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217326830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217326830">(Nov 19 2020 at 20:34)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I'm here</p>



<a name="217326899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217326899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217326899">(Nov 19 2020 at 20:35)</a>:</h4>
<p>Here's the patch in question: <a href="https://github.com/Xanewok/rust-semverver/commit/735056e898c25afb3778644634cc685c1ade7d5e">https://github.com/Xanewok/rust-semverver/commit/735056e898c25afb3778644634cc685c1ade7d5e</a></p>



<a name="217327638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217327638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217327638">(Nov 19 2020 at 20:42)</a>:</h4>
<p>so I intentionally limited the set of places where we use <code>leak_check</code> dramatically</p>



<a name="217327660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217327660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217327660">(Nov 19 2020 at 20:42)</a>:</h4>
<p>but I am not entirely sure what this function does</p>



<a name="217327711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217327711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217327711">(Nov 19 2020 at 20:42)</a>:</h4>
<p>oh, I see, you've not edited <em>rustc</em></p>



<a name="217327718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217327718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217327718">(Nov 19 2020 at 20:42)</a>:</h4>
<p>but rather the semverver tool</p>



<a name="217327719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217327719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217327719">(Nov 19 2020 at 20:43)</a>:</h4>
<p>hmm</p>



<a name="217327720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217327720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217327720">(Nov 19 2020 at 20:43)</a>:</h4>
<p>I'm not sure I understand the code entirely in semverver, I've been hacking there for a couple of days</p>



<a name="217327727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217327727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217327727">(Nov 19 2020 at 20:43)</a>:</h4>
<p>right</p>



<a name="217327838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217327838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217327838">(Nov 19 2020 at 20:43)</a>:</h4>
<p>so the code in question runs the... trait selection? on a pair of <code>fn(&amp;'static str)</code> and <code>fn(&amp;str)</code></p>



<a name="217327941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217327941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217327941">(Nov 19 2020 at 20:44)</a>:</h4>
<p>while version before correctly returned errors such as RegionsInsufficientlyPolymorphic, the version after the patch happily says it's <code>Ok(())</code></p>



<a name="217327973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217327973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217327973">(Nov 19 2020 at 20:44)</a>:</h4>
<p>and only after further running <code>leak_check</code> this case is caught</p>



<a name="217328014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328014">(Nov 19 2020 at 20:45)</a>:</h4>
<p>but that's the first time I'm touching <code>InferCtxt</code> and anything there, so I'm not really sure I'm doing the right thing here</p>



<a name="217328029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328029">(Nov 19 2020 at 20:45)</a>:</h4>
<p>can you refresh my memory as to the old/new tests?</p>



<a name="217328038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328038">(Nov 19 2020 at 20:45)</a>:</h4>
<p>I can't seem to find the links above</p>



<a name="217328040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328040">(Nov 19 2020 at 20:45)</a>:</h4>
<p>(and/or the original was correct in the first place)</p>



<a name="217328045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328045">(Nov 19 2020 at 20:45)</a>:</h4>
<p>I mean I'm sure they're there somewhere</p>



<a name="217328062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328062">(Nov 19 2020 at 20:45)</a>:</h4>
<p><a href="https://github.com/Xanewok/rust-semverver/tree/735056e898c25afb3778644634cc685c1ade7d5e/tests/cases/regions">https://github.com/Xanewok/rust-semverver/tree/735056e898c25afb3778644634cc685c1ade7d5e/tests/cases/regions</a></p>



<a name="217328138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328138">(Nov 19 2020 at 20:46)</a>:</h4>
<p>Old:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">efg</span><span class="p">(</span><span class="n">_</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="nb">static</span> <span class="kt">str</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">fgh</span><span class="p">(</span><span class="n">_</span>: <span class="kp">&amp;</span><span class="kt">str</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>New:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">efg</span><span class="p">(</span><span class="n">_</span>: <span class="kp">&amp;</span><span class="kt">str</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">fgh</span><span class="p">(</span><span class="n">_</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="nb">static</span> <span class="kt">str</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="217328140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328140">(Nov 19 2020 at 20:46)</a>:</h4>
<p>ok so the tests are <code>efg</code> and <code>fgh</code>, right?</p>



<a name="217328196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328196">(Nov 19 2020 at 20:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="153740">Igor Matuszewski</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/leak-check.20in.20coherence/near/217327941">said</a>:</p>
<blockquote>
<p>while version before correctly returned errors such as RegionsInsufficientlyPolymorphic, the version after the patch happily says it's <code>Ok(())</code></p>
</blockquote>
<p>yeah so what happens here</p>



<a name="217328231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328231">(Nov 19 2020 at 20:47)</a>:</h4>
<p>is that we wind up generating region constraints that can't be satisfied</p>



<a name="217328241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328241">(Nov 19 2020 at 20:47)</a>:</h4>
<p>the <code>leak_check</code> code <em>will</em> detect them</p>



<a name="217328266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328266">(Nov 19 2020 at 20:47)</a>:</h4>
<p>it's not necessarily wrong for the semverver tool to do that</p>



<a name="217328277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328277">(Nov 19 2020 at 20:47)</a>:</h4>
<p>I have a write-up that explains this stuff in more detail</p>



<a name="217328280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328280">(Nov 19 2020 at 20:47)</a>:</h4>
<p>I should go re-read it</p>



<a name="217328340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328340">(Nov 19 2020 at 20:48)</a>:</h4>
<p><a href="https://gist.github.com/nikomatsakis/8bfda6c1119727e13ec6e98f33d2b696">https://gist.github.com/nikomatsakis/8bfda6c1119727e13ec6e98f33d2b696</a></p>



<a name="217328357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328357">(Nov 19 2020 at 20:48)</a>:</h4>
<p>( this was <a href="https://github.com/rust-lang/compiler-team/issues/295">https://github.com/rust-lang/compiler-team/issues/295</a> )</p>



<a name="217328389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328389">(Nov 19 2020 at 20:48)</a>:</h4>
<p>I... actually didn't read this write-up <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span></p>



<a name="217328401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328401">(Nov 19 2020 at 20:49)</a>:</h4>
<p>I should've, my bad</p>



<a name="217328462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328462">(Nov 19 2020 at 20:49)</a>:</h4>
<p>I'l try to skim through it quickly now if that helps</p>



<a name="217328699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328699">(Nov 19 2020 at 20:52)</a>:</h4>
<p>well</p>



<a name="217328731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328731">(Nov 19 2020 at 20:52)</a>:</h4>
<p>I think that adding the leak check is not wrong</p>



<a name="217328753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328753">(Nov 19 2020 at 20:52)</a>:</h4>
<p>I was going to suggest maybe you want to run the region checker</p>



<a name="217328763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328763">(Nov 19 2020 at 20:52)</a>:</h4>
<p>but the truth is that we plan to <em>remove</em> the lexical region checker</p>



<a name="217328788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328788">(Nov 19 2020 at 20:52)</a>:</h4>
<p>and I think the leak check will kind of <em>be</em> the "identify unsolveable constraints" function that you want</p>



<a name="217328816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328816">(Nov 19 2020 at 20:53)</a>:</h4>
<p>I don't think you necessarily have to read the gist, <span class="user-mention" data-user-id="153740">@Igor Matuszewski</span>, it's fairly detailed</p>



<a name="217328835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328835">(Nov 19 2020 at 20:53)</a>:</h4>
<p>hm interesting</p>



<a name="217328842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328842">(Nov 19 2020 at 20:53)</a>:</h4>
<p>but it does try to give all the background if you want a "deeper dive"</p>



<a name="217328969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217328969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217328969">(Nov 19 2020 at 20:54)</a>:</h4>
<p>so the main functions really is to compare such that the new type is either same, more relaxed (technically breaking) or incompatible (as I understand it)</p>



<a name="217329004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329004">(Nov 19 2020 at 20:54)</a>:</h4>
<p>I guess we can treat it as solving the constraints, right?</p>



<a name="217329009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329009">(Nov 19 2020 at 20:54)</a>:</h4>
<p>via this mechanism used</p>



<a name="217329030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329030">(Nov 19 2020 at 20:55)</a>:</h4>
<p>if we want to reason about regions</p>



<a name="217329212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329212">(Nov 19 2020 at 20:56)</a>:</h4>
<p>where is the overall repo?</p>



<a name="217329213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329213">(Nov 19 2020 at 20:56)</a>:</h4>
<p>I'm not sure how to translate it into more rigid model, I would assume we are actually checking if the new type is a subtype (and potentially equal, not sure what this relation's definition is) of the old one, right?</p>



<a name="217329221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329221">(Nov 19 2020 at 20:56)</a>:</h4>
<p>I'd like to skim the code a bit more</p>



<a name="217329234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329234">(Nov 19 2020 at 20:56)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust-semverver">https://github.com/rust-lang/rust-semverver</a></p>



<a name="217329307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329307">(Nov 19 2020 at 20:57)</a>:</h4>
<p>As it is, it supports <code>nightly-2020-06-23</code></p>



<a name="217329410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329410">(Nov 19 2020 at 20:58)</a>:</h4>
<p>the WIP PR bumping to the newest version is at <a href="https://github.com/Xanewok/rust-semverver/tree/rustup-wip">https://github.com/Xanewok/rust-semverver/tree/rustup-wip</a> but there aren't many significant changes, it seems (maybe except <a href="https://github.com/Xanewok/rust-semverver/commit/1f8cb2e4de1df65cedbbf55d1f9f06e2572cccad">https://github.com/Xanewok/rust-semverver/commit/1f8cb2e4de1df65cedbbf55d1f9f06e2572cccad</a>)</p>



<a name="217329961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329961">(Nov 19 2020 at 21:03)</a>:</h4>
<p>so one thing I notice is that</p>



<a name="217329971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329971">(Nov 19 2020 at 21:03)</a>:</h4>
<p>the code runs</p>



<a name="217329975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329975">(Nov 19 2020 at 21:03)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">            </span><span class="bp">self</span><span class="p">.</span><span class="n">infcx</span><span class="p">.</span><span class="n">resolve_regions_and_report_errors</span><span class="p">(</span><span class="w"></span>
<span class="w">                </span><span class="n">target_def_id</span><span class="p">,</span><span class="w"></span>
<span class="w">                </span><span class="o">&amp;</span><span class="n">outlives_env</span><span class="p">,</span><span class="w"></span>
<span class="w">                </span><span class="n">RegionckMode</span>::<span class="n">default</span><span class="p">(),</span><span class="w"></span>
<span class="w">            </span><span class="p">);</span><span class="w"></span>
</code></pre></div>



<a name="217329979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329979">(Nov 19 2020 at 21:04)</a>:</h4>
<p>but <em>only</em> in the case of type error</p>



<a name="217329993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217329993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217329993">(Nov 19 2020 at 21:04)</a>:</h4>
<p>that seems a bit odd</p>



<a name="217330058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217330058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217330058">(Nov 19 2020 at 21:04)</a>:</h4>
<p>that code is really meant to be run if the "subtype" operations etc complete <em>successfully</em></p>



<a name="217330092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217330092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217330092">(Nov 19 2020 at 21:04)</a>:</h4>
<p>but anyway I think running leak-check is ok here <span class="user-mention" data-user-id="153740">@Igor Matuszewski</span></p>



<a name="217330096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217330096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217330096">(Nov 19 2020 at 21:04)</a>:</h4>
<p>I noticed that as well, amusingly tests fail when running the care in regular path but I didn't take a closer look at the regressions</p>



<a name="217330114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217330114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217330114">(Nov 19 2020 at 21:05)</a>:</h4>
<p>I would maybe add a comment like "check for unresolveable lifetime constraints"</p>



<a name="217330147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217330147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217330147">(Nov 19 2020 at 21:05)</a>:</h4>
<p>so if leak-checker behaves sort of like the current region solver, is it necessary to run the lexical region resolve there at all? Even in the error case</p>



<a name="217330252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217330252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217330252">(Nov 19 2020 at 21:06)</a>:</h4>
<p>it does so because we need to later call <code>resolve_vars_if_possible</code>?</p>



<a name="217330353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217330353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217330353">(Nov 19 2020 at 21:07)</a>:</h4>
<p>that's probably somewhat off-topic</p>



<a name="217330494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217330494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217330494">(Nov 19 2020 at 21:08)</a>:</h4>
<p>ah no that was <code>lexical_region_resolve</code>, I mixed these</p>



<a name="217330516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217330516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217330516">(Nov 19 2020 at 21:09)</a>:</h4>
<p>as you're seeing I'm still trying to wrap my head around it <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="217330788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217330788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217330788">(Nov 19 2020 at 21:11)</a>:</h4>
<p>Anyways, <span class="user-mention" data-user-id="116009">@nikomatsakis</span> many thanks for taking a look!</p>



<a name="217331205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217331205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217331205">(Nov 19 2020 at 21:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="153740">Igor Matuszewski</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/leak-check.20in.20coherence/near/217330147">said</a>:</p>
<blockquote>
<p>so if leak-checker behaves sort of like the current region solver, is it necessary to run the lexical region resolve there at all? Even in the error case</p>
</blockquote>
<p>no, not really</p>



<a name="217331228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217331228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217331228">(Nov 19 2020 at 21:15)</a>:</h4>
<p>it may produce better errors though</p>



<a name="217331245"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217331245" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217331245">(Nov 19 2020 at 21:15)</a>:</h4>
<p>but that code will eventually go away I think</p>



<a name="217331263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217331263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217331263">(Nov 19 2020 at 21:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="153740">Igor Matuszewski</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/leak-check.20in.20coherence/near/217330252">said</a>:</p>
<blockquote>
<p>it does so because we need to later call <code>resolve_vars_if_possible</code>?</p>
</blockquote>
<p>(it may produce better errors because of this, yeah)</p>



<a name="217331376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217331376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217331376">(Nov 19 2020 at 21:16)</a>:</h4>
<p>it <em>may</em> be necessary for that fn not to ICE or something, not sure</p>



<a name="217331491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217331491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217331491">(Nov 19 2020 at 21:17)</a>:</h4>
<p>There were some noises to upstream some of the comparison logic and maintain it on the compiler side - maybe that would keep the code in more loved and maintainable shape</p>



<a name="217331575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/leak-check%20in%20coherence/near/217331575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/leak-check.20in.20coherence.html#217331575">(Nov 19 2020 at 21:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/leak-check.20in.20coherence/near/217331245">said</a>:</p>
<blockquote>
<p>but that code will eventually go away I think</p>
</blockquote>
<p>we'l worry about that if/when semverver breaks because of that <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>